﻿using Avalonia.Controls;
using Avalonia.Controls.Notifications;
using AzrngTools.ViewModels;

namespace AzrngTools.Views
{
    public partial class OverviewPageView : ViewControlBase
    {
        public OverviewPageView()
        {
            InitializeComponent();
            this.DataContext = new OverviewPageViewModel();
        }

        private WindowNotificationManager _manager;

        protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
        {
            base.OnAttachedToVisualTree(e);

            // 注册通知页面
            var topLevel = TopLevel.GetTopLevel(this);
            _manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };

            App.NotificationPage = _manager;
        }
    }
}